package cn.itcast.bitmapdemo;

import androidx.appcompat.app.AppCompatActivity;

import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

public class FrameAnimationActivity extends AppCompatActivity {
    ImageView imageView;
    private AnimationDrawable background;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_frame_animation);
        init();
    }

    private void init() {
        imageView = findViewById(R.id.iv_wifi);
        background = (AnimationDrawable) imageView.getBackground();
    }
    public void startAnimation(View view) {
        //Animation animation = AnimationUtils.loadAnimation(this,R.anim.alpha_animation);
        //myView.startAnimation(animation);


        background.start();


    }

    public void stopAnimation(View view) {
        background.stop();
    }
}